export function throttle(fn, interval, ctx = null) {
  let last;
  return function(...args) {
    if (last === undefined || +new Date() - last >= interval) {
      last = +new Date();
      fn.call(ctx, ...args);
    }
  };
}
